package com.diana.springboot.service.impl;

import com.diana.springboot.mapper.PetchatArticleMapper;
import com.diana.springboot.model.PetchatArticle;
import com.diana.springboot.model.PetchatArticleExample;
import com.diana.springboot.service.PetchatArticleService;
import com.diana.springboot.util.ExceptionUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author Suna
 * @Date 2020/8/13 15:36
 */
@Service
public class PetchatArticleServiceImpl implements PetchatArticleService {

    @Autowired
    PetchatArticleMapper petchatArticleMapper;

    private static Log log = LogFactory.getLog(PetchatArticleServiceImpl.class);

    @Override
    public List<PetchatArticle> listPetchatArticle() {
        List<PetchatArticle> petchatArticleList = new ArrayList<>();
        try {
            PetchatArticleExample petchatArticleExample = new PetchatArticleExample();
            petchatArticleList = petchatArticleMapper.selectByExampleWithBLOBs(petchatArticleExample);
        }catch (Exception e){
            log.error(ExceptionUtil.toString(e));
        }
        return petchatArticleList;
    }
}
